/*
 * @Author: zt0233
 * @Date: 2022-01-12 14:05:56
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-08-07 17:12:07
 * @FilePath: \web-pc\src\pages\big-screen\main.js
 */
import Vue from "vue";
import App from "./App.vue";
import router from './router'
import store from './store'
import {loading,borderBox13,digitalFlop,capsuleChart,borderBox8} from '@jiaminghi/data-view'
import { Radio, Button, RadioGroup, Tree } from 'element-ui'
import Echart from './components/echart/index.vue'
import ItemWrap from './components/item-wrap/item-wrap.vue'
import Message from './components/message/message.vue'
import Reacquire from './components/reacquire/reacquire.vue'
import Messages from './components/message/message'
import "vue-easytable/libs/theme-default/index.css";
import  '@/assets/css/public.scss'
import "@/assets/css/index.scss"
import 'ol/ol.css'


import * as filters from '@/directives/filters'

// 确保在应用启动前加载mock数据
console.log('%c正在加载模拟数据...', 'color: blue; font-weight: bold');

try {
  // 使用require加载模拟数据
  const mockData = require('./mock/mockData');
  console.log('%c模拟数据加载成功', 'color: green; font-weight: bold');
  console.log('模拟数据模块:', mockData);
} catch (error) {
  console.error('%c模拟数据加载失败', 'color: red; font-weight: bold', error);
}

// 检查XMLHttpRequest是否被成功拦截
console.log('XMLHttpRequest状态:', window.XMLHttpRequest.toString().includes('native') ? '原生未被拦截' : '已被拦截');
console.log('__mockDataInitialized状态:', window.__mockDataInitialized ? '已初始化' : '未初始化');
Vue.config.productionTip = false;

// 自定义组件
Vue.component("Echart",Echart)
Vue.component("ItemWrap",ItemWrap)
Vue.component("Message",Message)
Vue.component("Reacquire",Reacquire)
Vue.prototype.$Message =  Messages
// element组件
Vue.use(Radio);
Vue.use(Button);
Vue.use(RadioGroup);
Vue.use(Tree)

// datav组件
Vue.use(loading)
Vue.use(borderBox13)
Vue.use(borderBox8)
Vue.use(digitalFlop)
Vue.use(capsuleChart)
// 全局数据过滤器
Object.keys(filters).forEach(k => Vue.filter(k, filters[k]));
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");